home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample PMSAM / PMSAM Framework / RoboSamSlot / XLetter.h < prev   
Encoding:
C/C++ Source or Header  |  1995-07-28  |  2.6 KB  |  100 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        XLetter.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    Tim Harnett
  7.  
  8.     Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <7>     1/27/95    TMH        added IsValidRecipeint
  13.          <6>     1/13/95    TMH        seperated OutgoingXLetter to seperate file
  14.          <5>     1/11/95    TMH        tweak to generalize framework
  15.          <4>    10/13/94    TMH        added AbortSend()
  16.          <3>     10/3/94    TMH        break of TWireless&TEWorld from TExternalSlot
  17.          <2>     9/30/94    TMH        parse incoming InfoWave letter properly
  18.          <1>     9/20/94    TMH        Abandon RoadsideRest embrace Mercury
  19.          <2>     9/20/94    TMH        some mods when writing a letter, use InfoWave letter format,
  20.                                     experimental
  21.                   9/1/94    TMH        xxx put comment here xxx
  22.  
  23.     To Do:
  24. */
  25.  
  26. #ifndef __XLetter__
  27. #define __XLetter__
  28.  
  29. class TExternalSlot;
  30. class TIncomingALetter;
  31. class TOutgoingALetter;
  32.  
  33. #ifndef __FileUtils__
  34. #include "FileUtils.h"
  35. #endif
  36.  
  37. #ifndef __Letter__
  38. #include "Letter.h"
  39. #endif
  40.  
  41. #ifndef __OutgoingLetterStream__
  42. #include "OutgoingLetterStream.h"
  43. #endif
  44.  
  45. //---------------------------------
  46. //        U t i l i t i e s
  47. //---------------------------------
  48. extern void MapOtherRecipient(CUnpackedDSSpec& unpackedRecipient,StringPtr otherRecipient);
  49. extern Boolean IsValidRecipient(CUnpackedDSSpec& unpackedRecipient);
  50.  
  51. //--------------------------------------
  52. //        T X L e t t e r
  53. //--------------------------------------
  54.  
  55. class TXLetter : public TLetter {
  56. public:
  57.         TXLetter();
  58.         void    IXLetter(TExternalSlot* xSlot);
  59. protected:
  60.  
  61.         TExternalSlot*    fXSlot;
  62.  
  63. };
  64.  
  65.  
  66. //--------------------------------------
  67. //        T I n c o m i n g X L e t t e r
  68. //--------------------------------------
  69.  
  70. //    An incomming external letter.
  71.  
  72. class TIncomingXLetter : public TXLetter {
  73. public:
  74.                         TIncomingXLetter();
  75.                         ~TIncomingXLetter();
  76.     void                IIncomingXLetter(TExternalSlot* xSlot,CFile& incomingLetterFile);
  77.     
  78.     void                ParseAndValidateLetter();
  79.     
  80.     void                DeliveryDone();
  81.     
  82.     void                SetToStartOfBody()  { fIncomingLetterFile.SetPosition(fBodyOffset); }
  83.     long                ReadBody(char* readBuf,long readBufSize);
  84.  
  85.  
  86.     void                SetToStartOfToRecipients()  { fIncomingLetterFile.SetPosition(fToRecipientsOffset); }
  87.     StringPtr            ReadToRecipient(StringPtr toRecipient);
  88.     
  89. private:
  90.  
  91.  
  92.     CFile                fIncomingLetterFile;    //  the file that contains the incoming letter from the external system    
  93.  
  94.     long                fToRecipientsOffset;    //    offset where the To: addresses start
  95.     long                fBodyOffset;            //    offset where the body of the letter starts.
  96.     long                fSenderNameOffset;        //    offset where the body of the letter starts.
  97.     long                fSubjectOffset;            //    offset where the body of the letter starts.
  98. };
  99.  
  100. #endif __XLetter__